package lib.self.bean;

import android.content.Context;
import android.util.DisplayMetrics;

/**
 * description: 屏幕信息
 * author: Steven Xiao
 * date: 2017/4/1
 */
public final class Screen {
    public int mWidth = 0;//屏幕宽度
    public int mHeight = 0;//屏幕高度
    public float mDensity = 0;// 屏幕密度 0.75 / 1.0 / 1.5 / 2.0

    public Screen(Context context) {
        getDefaultScreenInfos(context);
    }

    public void getDefaultScreenInfos(Context context) {
        DisplayMetrics metrics = context.getResources().getDisplayMetrics();
        mWidth = metrics.widthPixels;
        mHeight = metrics.heightPixels;
        mDensity = metrics.density;
    }
}
